import http from './index';

// 列表数据
export const getActivityList = (currentPage, pageSize) => http({
  url: '/b/activity/list',
  method: 'GET',
  params: {
    currentPage, pageSize
  }
});

// 获取列表总数量
export const getActivityTotal = () => http({
  url: '/b/activity/total',
  method: 'GET'
});

// 删除活动
export const delActivityApi = (id) => http({
  url: '/b/activity/del',
  method: 'GET',
  params: {
    id
  }
})

// 分类数量
export const getActivityCategoryCountApi = () => http({
  url: '/b/activity/category/total',
  method: 'GET',
})

// 分类列表
export const getActivityCategoryListApi = (currentPage, pageSize) => http({
  url: '/b/activity/category/list',
  method: 'GET',
  params: {
    currentPage, pageSize
  }
})
// 分类新增
export const addActivityCategoryApi = (categoryName) => http({
  url: '/b/activity/category/list',
  method: 'POST',
  data: {
    activityCategoryName: categoryName,
    activityCategoryIcon: 'default.png'
  }
})
// 分类编辑
export const editActivityCategoryApi = (activityCategoryName, activityCategoryId) => http({
  url: '/b/activity/category/edit',
  method: 'POST',
  data: {
    activityCategoryName,
    activityCategoryIcon: 'default.png',
    activityCategoryId
  }
})
// 分类删除
export const delActivityCategoryApi = (activityCategoryId) => http({
  url: '/b/activity/category/del',
  method: 'GET',
  params: {
    activityCategoryId
  }
})